<%@ page contentType="text/html; charset=UTF-8"%>
<%@include file="/common/jsloader.jsp"%>
<html>
<head>
  <title>客户管理系统</title>
  <script type="text/javascript">
  JSLoader.loadJavaScript("<%=contextPath %>/js/Ext.ux.Notification.js");
  </script>
  <style>
		body {overflow: hidden;}
		.x-icon-error{background-image:url(<%=contextPath %>/image/exclamation.gif) ! important;}
		.x-icon-information{background-image:url(<%=contextPath %>/image/information.gif) ! important;}
		.x-notification .x-window-body{margin: 0;padding:1em ! important; width: auto ! important;}
		.x-notification .x-tool-close{display: none}
		.x-notification.fixed .x-tool-close{display: block}
  </style>
  <script type="text/javascript">
    Ext.onReady(function(){
        Ext.state.Manager.setProvider(new Ext.state.CookieProvider());
        var tb = new Ext.Toolbar();
		var menu1 = new Ext.menu.Menu({
		      shadow:'frame',
		      defaults:{style:'font-size:13pt'},
			  items:[
			  {text:'新建一',listeners:{click:test}},
			  {text:'新建二',listeners:{click:test1}}
			  ]
		});

        tb.add({
		   text:'用户管理',
		   iconCls: 'house',
		   style:'font-size:13pt',
		   minSize: 175,
	       maxSize: 400,
		   labelStyle:'font-size:13pt',
		   cls:'font-size:13pt',
		   menu:menu1
		});

		tb.addSeparator();

        var menu2 = new Ext.menu.Menu({
		      shadow:'frame',
		      defaults:{style:'font-size:13pt'},
			  items:[
			  {text:'新建一',listeners:{click:test}},
			  {text:'新建二'}
			  ]
		});
        
		tb.add({
		   text:'消息管理',
		   cls: 'a-class-name', 
		   iconCls: 'add16',
		   menu:menu2
		});
		tb.addSeparator();

		function test()
		{
		   // alert(Ext.get('indexTabPanel').isVisible());
			var tbbs = Ext.getCmp('indexTabPanel');
		    tbbs.add({
            title: 'New Tab ',
            iconCls: 'tabs',
            html: '<iframe src="login.jsp" width="100%" height="100%"></iframe>',
            closable:true
           }).show();
		}
		

        var viewport = new Ext.Viewport({ 
            layout: 'border',
            items: [
			 new Ext.Panel({
			   region: 'north',
			   tbar:tb,
			   height:30
			 }), 
            // in this instance the TabPanel is not wrapped by another panel
            // since no title is needed, this Panel is added directly
            // as a Container
            new Ext.TabPanel({
			    id:'indexTabPanel',
                region: 'center', // a center region is ALWAYS required for border layout
                deferredRender: false,
                activeTab: 0,     // first tab initially active
                style:'font-size: 13pt',
                items: [{
                    title: '我的主页',
                    style:'font-size: 13pt',
                    autoScroll:true
                }]
            })]
        });
    });
    
    function test1()
	{
		new Ext.ux.Notification({
			autoHide:true,
			hideDelay:1000//autoHide为true，hideDelay起作用,
		}).showSuccess('无提示版成功信息','<h1>操作成功,不隐藏窗口</h1>根据Notification初始化参数来确定是否隐藏窗口'); 
	}
    
    setInterval("test1()",120000);
    </script>
</head>
<body>
</body>
</html>